package cn.yitun.chat.yitunservermanagecore.general.manage.core.service.impl;

import cn.yitun.chat.yituncommonutil.YitunMapUtil;
import cn.yitun.chat.yitunservercommonlib.dataentity.dto.login.LoginLogDto;
import cn.yitun.chat.yitunservercommonlib.dataentity.vo.login.LoginLogVo;
import cn.yitun.chat.yitunserverimbase.dao.login.LoginLogDao;
import cn.yitun.chat.yitunservermanagecore.general.manage.core.service.LoginLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;
/**
 * 登录日志
 */
@Slf4j
@Service
public class LoginLogServiceImpl implements LoginLogService {


    @Autowired
    private LoginLogDao loginLogDao;



    /**
     * 登录日志
     * @param dto
     * @return
     */
    @Override
    public List<LoginLogVo> listLoginLog(LoginLogDto dto) {
        return loginLogDao.listVO(YitunMapUtil.java2Map(dto,false));
    }

    /**
     *
     * @param params
     * @return
     */
    @Override
    public int countLoginLog(Map<String, Object> params) {
        return loginLogDao.count(params);
    }

    @Transactional
    @Override
    public int remove(Long id) {
        return loginLogDao.remove(id);
    }
    @Transactional
    @Override
    public int batchRemove(Long[] ids) {
        return loginLogDao.batchRemove(ids);
    }
}
